select * from sc_scheduleevent_list

select * from sc_scheduleevent_options

select * from sc_scheduleevent_contributor

select * from sc_scheduleevent_response

ALTER TABLE sb_comment_comment ALTER COLUMN instanceid DROP NOT NULL;

select * from sb_comment_comment order by commentid desc

select * from sr_packages

delete from sr_packages where sr_package = 'myjarsettests'

ALTER TABLE SB_Comment_Comment
ALTER COLUMN instanceid SET NOT NULL
;

ALTER TABLE SB_Comment_Comment
ADD resourceType varchar (50) not null
;

ALTER TABLE SB_Comment_Comment
DROP resourceType
;

ALTER TABLE SB_Comment_Comment
ALTER COLUMN foreignId TYPE bigint
;


-- Starting structure modifications
ALTER TABLE SB_Comment_Comment
ALTER COLUMN instanceid DROP NOT NULL
;

ALTER TABLE SB_Comment_Comment
ALTER COLUMN foreignId TYPE bigint
;

UPDATE SB_Comment_Comment
SET resourceId = 'MyTests_Contact_List'

UPDATE sb_comment_comment
SET resourceType = 'MyTests_Contact'

ALTER TABLE SB_Comment_Comment
ADD resourceType VARCHAR(50) null
;

-- Data recovery
UPDATE SB_Comment_Comment
SET resourceType = '#null#';

-- Ending structure modifications
ALTER TABLE SB_Comment_Comment
ALTER COLUMN resourceType SET NOT NULL
;

ALTER TABLE SB_Comment_Comment
ALTER COLUMN foreignId TYPE VARCHAR(50)

ALTER TABLE SB_Comment_Comment
RENAME resourceId TO foreignId
;